1. Field of the Invention
The invention relates to a method for code stream control, more particularly to a method for video data stream integration and compensation that can ensure signal reception quality even if there is serious packet loss during the process of video signal transmission.
2. Description of the Related Art
Due to the development of audiovisual multimedia and digital communications technologies, digital video processing systems are heading toward diversified applications. Occurrence of such a phenomenon can be attributed to the development of video signal encoding standards. With these encoding standards, a consistent communications standard for transmission among systems is made possible. Video signal encoding standards have the function of compressing data. This is necessary because source multimedia data are extremely huge. If they are not compressed to reduce the amount of data, they will take up too much bandwidth, and the receiving end would not be able to receive the huge flow of data without large delay and packet loss, thereby increasing the likelihood of errors.
Currently, there are two official organizations that set up video signal compression encoding standards. One is the ITU Telecommunication Standardization Sector (ITU-T). The other is the International Standard Organization (ISO/IEC JTC1). The ITU-T video signal compression encoding standard is expressed in H.26x format, e.g., H.261, H.262, H.263, and H.264. On the other hand, the ISO/IEC video signal compression encoding standard is expressed in MPEG-x format, e.g., MPEG-1, MPEG-2, MPEG-4, and MPEG-4 AVS.
As shown in FIG. 1, in a data stream of an MPEG video coded image, the data structure is formed by one or more sequences. Each sequence contains at least a group of pictures (GOP). The so-called GOP refers to a group formed by a plurality of frames or pictures. According to their attributes, the frames can be divided into three types: intra-coded frames (I frame), predictive-coded frames (P frame), and bidirectionally predictive-coded frames (B frame).
The intra-coded frame (I frame) is also referred to as a reference image or key frame. The predictive-coded frame (P frame) is referred to as a current image or non-key frame. Since the I frames and the P frames are adjacent to each other, and have a high degree of similarity, the P frames can be compressed by block matching, motion estimation, and motion compensation with reference to the previous I frames, and good compression results can be obtained. Hence, by reducing temporal redundancy between successive frames, data storage space can be saved.
Referring again to FIG. 1, in the MPEG compression standard, each frame is divided into a plurality of slices. Each slice is in turn divided into a plurality of macroblocks. Each macroblock is composed of luminance blocks and chrominance blocks. Each block is defined as the smallest coded unit of the MPEG data structure. In the process of motion compensation, block-based motion vector estimation is used.
Referring to FIG. 2, which illustrates a motion vector estimation in the MPEG compression standard, the search method is, for a predetermined block 51 in a current frame 501, to search and find matching pixels corresponding to the predetermined block 51 from a reference frame 502 preceding the current frame 501 so as to estimate a motion vector 53 of the predetermined block 51. In the aforesaid method, a predetermined point 520 in the reference frame 502 serves as an initial position, and a region (not shown) having the predetermined point 520 as the center serves as the search area until a matching block is found in the current frame 501 for estimating the motion vector 53.
With the estimation of the motion vector 53, and by means of each block in the current frame 501 and the optimum matching block found from the reference frame 502, the blocks in the current frame 501 can be correlated to those in the reference frame 502 using the calculated motion vector 53 and difference data such that the blocks can be shifted to proper positions according to the motion vector 53. Since it is no longer necessary to record a large portion of redundant data, the amount of data to be stored can be reduced, thereby achieving the objective of data compression.
However, when transmitting compressed video stream over the Internet, some of the information in the reference frame 502 may be lost due to the limited bandwidth and high compression rate. If the loss of information is excessive, the current frame 501 cannot be effectively recovered, resulting in degraded picture quality and being difficult to be identified clearly. All of this is due to the fact that existing technologies are incapable of effecting corresponding adjustment according to actual transmission conditions so as to maintain the required video quality.